﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections.ObjectModel;
using University.Workshop.Business;
using University.Workshop.Model;
using University.Workshop.DataAccess;

namespace University.Workshop.WebApp
{
    public partial class FindWishList : System.Web.UI.Page
    {
        User user = new User();
        protected void Page_Load(object sender, EventArgs e)
        {
            user = UserDataAccess.GetUserByEmail(User.Identity.Name);
        }

        protected void SearchButton_Click(object sender, EventArgs e)
        {
                //Collection<User> users = FindWishListManager.FindWishList(TextBox1.Text,TextBox1.Text);

                if (user.PersonalInformation.FirstName != TextBox1.Text)
                {
                    GridView1.DataSource = FindWishListManager.GetUserBySpecificName(TextBox1.Text);
                    GridView1.DataBind();
                }
            // User user = UserDataAccess.GetUserByEmail(User.Identity.Name);
                //AvailableProductNotification.SendNotificationMail(user);
           
        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewRow row = GridView1.SelectedRow;
            Response.Redirect("SomeoneWishList.aspx?GuestUserId="+row.Cells[1].Text);
        }
    }
}